package com.martin.fastframe.ui.penetrate

import android.view.View
import com.martin.fastframe.R
import com.martin.fastframe.databinding.ItemPenetrateBinding
import com.martin.lib_base.annotation.ItemData
import com.martin.lib_base.base.BaseViewHolder
import com.martin.lib_base.interfaces.IItemData
import dev.utils.app.ViewUtils

/**
 * @desc：穿透测试
 */
@ItemData(PenetrateViewHolder.Companion.ItemData::class)
class PenetrateViewHolder(view: View) : BaseViewHolder<Any, ItemPenetrateBinding>(view) {

    override fun onBindViewHolder(position: Int, item: Any?) {
        binding.fl.post {
            ViewUtils.setHeight(binding.fl, ViewUtils.getWidth(binding.fl))
        }

        binding.fl.setOnClickListener {
            notifyItemClick()
        }
    }

    companion object {
        class ItemData : IItemData {
            override fun getItemLayoutId() = R.layout.item_penetrate
        }
    }
}